package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @author 山顶洞人郑某
 * @className UserMapper.java
 * @date 2024 02 07
 */
@Mapper
public interface UserMapper {
    @Select("select * from sky_take_out.user where openid = #{openid}")
    User getByOpenId(String openid);

    void insert(User user);

    @Select("select * from sky_take_out.user where  id = #{userId}")
    User getById(Long userId);

    /**
     * 根据条件查询用户数量
     * @param map
     * @return
     */
    Integer countByMap(Map<String ,Object> map);



}
